@echo off
set indir =%cd%\images-optional

del /f /s /q bgr\*.*
del /f /s /q data\*.*
del /f /s /q list.txt

for /r %%i in (%indir%*.jpg) do (
%cd%\jpg2bgr.exe  %%i %cd%\bgr\%%~ni.bgr 608 >> %cd%\data\%%~ni.dat
echo ./bgr/%%~ni.bgr>>list.txt
)